/*! \file */
/// \addtogroup MegaMan
/// \{
#ifndef __p2anim_h__
#define __p2anim_h__

#include "MegaMan.h"

// Macro definitions
// Bit shift magic
#define getRightN(pixelByte) (pixelByte & 0x0F)
#define getLeftN(pixelByte) (pixelByte >> 4 & 0x0F)

#define setRightN(buffer,pixelByte) buffer = (buffer & 0xF0 | (pixelByte & 0x0F))
#define setLeftN(buffer,pixelByte) buffer = (buffer & 0x0F| (pixelByte << 4 & 0xF0))

#define joinNibbles(pixelByte,lsbPixel,msbPixel) pixelByte = (lsbPixel & 0x0F| msbPixel << 4 & 0xF0)

#define scrollDelay 40	///< speed of scroll - higher is slower

void p2animRomantic(void);
void p2animScrollText(char *);
void putPixelBuffer(uint8_t, uint8_t, uint8_t, uint8_t);
void leftShiftScreen(uint8_t, uint8_t);
void rightShiftScreen(uint8_t, uint8_t);
void downShiftScreen(void);
void upShiftScreen(void);

#define FRAME_BUFFER_SIZE 325 			// 25*25 = 625 LED, 2 LEDs per byte -> 13B * 25 = 325B
extern uint8_t frameBuffer[FRAME_BUFFER_SIZE];	// extern means we don't create the variable here - done in library

#endif /* __p2anim_h__ */

/// \}
